package com.example.demo.core.result;



import lombok.Data;

import java.io.Serializable;

@Data
public class CommonResult implements Serializable {

    private static final long serialVersionUID = 7070149896025566800L;
    /**
     * 返回code
     */
    private int code;

    /**
     * 结果描述
     **/
    private String message;

    /**
     * 返回结果
     */
    private Object data;

    public CommonResult() {
        this.code = BaseResultCode.SUCCESS.getCode();
        this.message = BaseResultCode.SUCCESS.getMsg();
    }

    public CommonResult(ResultCode resultCode) {
        this.code = resultCode.getCode();
        this.message = resultCode.getMsg();
    }


    public CommonResult(int bizCode, String bizMsg) {
        this.code = bizCode;
        this.message = bizMsg;
    }

}
